85 research outputs found
Clousot: Static Contract Checking with Abstract Interpretation
We present an overview of Clousot, our current tool to statically check CodeContracts. CodeContracts enable a compiler and language-independent specification of Contracts (precondition, postconditions and object invariants). Clousot checks every method in isolation using an assume/guarantee reasoning: For each method under analysis Clousot assumes its precondition and asserts the postcondition. For each invoked method, Clousot asserts its precondition and assumes the postcondition. Clousot also checks the absence of common runtime errors, such as null-pointer errors, buffer or array overruns, divisions by zero, as well as less common ones such as checked integer overflows or floating point precision mismatches in comparisons. At the core of Clousot there is an abstract interpretation engine which infers program facts. Facts are used to discharge the assertions. The use of abstract interpretation (vs usual weakest precondition-based checkers) has two main advantages: (i) the checker automatically infers loop invariants letting the user focus only on boundary specifications; (ii) the checker is deterministic in its behavior (which abstractly mimics the flow of the program) and it can be tuned for precision and cost. Clousot embodies other techniques, such as iterative domain refinement, goal-directed backward propagation, precondition and postcondition inference, and message prioritization
Verification modulo versions: Towards usable verification
Abstract We introduce Verification Modulo Versions (VMV), a new static analysis technique for reducing the number of alarms reported by static verifiers while providing sound semantic guarantees. First, VMV extracts semantic environment conditions from a base program P. Environmental conditions can either be sufficient conditions (implying the safety of P) or necessary conditions (implied by the safety of P). Then, VMV instruments a new version of the program, P , with the inferred conditions. We prove that we can use (i) sufficient conditions to identify abstract regressions of P w.r.t. P; and (ii) necessary conditions to prove the relative correctness of P w.r.t. P. We show that the extraction of environmental conditions can be performed at a hierarchy of abstraction levels (history, state, or call conditions) with each subsequent level requiring a less sophisticated matching of the syntactic changes between P and P. Call conditions are particularly useful because they only require the syntactic matching of entry points and callee names across program versions. We have implemented VMV in a widely used static analysis and verification tool. We report our experience on two large code bases and demonstrate a substantial reduction in alarms while additionally providing relative correctness guarantees
CFA2: a Context-Free Approach to Control-Flow Analysis
In a functional language, the dominant control-flow mechanism is function
call and return. Most higher-order flow analyses, including k-CFA, do not
handle call and return well: they remember only a bounded number of pending
calls because they approximate programs with control-flow graphs. Call/return
mismatch introduces precision-degrading spurious control-flow paths and
increases the analysis time. We describe CFA2, the first flow analysis with
precise call/return matching in the presence of higher-order functions and tail
calls. We formulate CFA2 as an abstract interpretation of programs in
continuation-passing style and describe a sound and complete summarization
algorithm for our abstract semantics. A preliminary evaluation shows that CFA2
gives more accurate data-flow information than 0CFA and 1CFA.Comment: LMCS 7 (2:3) 201
Targeted Greybox Fuzzing with Static Lookahead Analysis
Automatic test generation typically aims to generate inputs that explore new
paths in the program under test in order to find bugs. Existing work has,
therefore, focused on guiding the exploration toward program parts that are
more likely to contain bugs by using an offline static analysis.
In this paper, we introduce a novel technique for targeted greybox fuzzing
using an online static analysis that guides the fuzzer toward a set of target
locations, for instance, located in recently modified parts of the program.
This is achieved by first semantically analyzing each program path that is
explored by an input in the fuzzer's test suite. The results of this analysis
are then used to control the fuzzer's specialized power schedule, which
determines how often to fuzz inputs from the test suite. We implemented our
technique by extending a state-of-the-art, industrial fuzzer for Ethereum smart
contracts and evaluate its effectiveness on 27 real-world benchmarks. Using an
online analysis is particularly suitable for the domain of smart contracts
since it does not require any code instrumentation---instrumentation to
contracts changes their semantics. Our experiments show that targeted fuzzing
significantly outperforms standard greybox fuzzing for reaching 83% of the
challenging target locations (up to 14x of median speed-up)
Channels as Objects in Concurrent Object-Oriented Programming
There is often a sort of a protocol associated to each class, stating when
and how certain methods should be called. Given that this protocol is, if at
all, described in the documentation accompanying the class, current mainstream
object-oriented languages cannot provide for the verification of client code
adherence against the sought class behaviour. We have defined a class-based
concurrent object-oriented language that formalises such protocols in the form
of usage types. Usage types are attached to class definitions, allowing for the
specification of (1) the available methods, (2) the tests clients must perform
on the result of methods, and (3) the object status - linear or shared - all of
which depend on the object's state. Our work extends the recent approach on
modular session types by eliminating channel operations, and defining the
method call as the single communication primitive in both sequential and
concurrent settings. In contrast to previous works, we define a single category
for objects, instead of distinct categories for linear and for shared objects,
and let linear objects evolve into shared ones. We introduce a standard sync
qualifier to prevent thread interference in certain operations on shared
objects. We formalise the language syntax, the operational semantics, and a
type system that enforces by static typing that methods are called only when
available, and by a single client if so specified in the usage type. We
illustrate the language via a complete example.Comment: In Proceedings PLACES 2010, arXiv:1110.385
11th International Conference on Practical Applications of Agents and Multi-Agent Systems
Research on Agents and Multi-agent Systems has matured during the last decade and many effective applications of this technology are now deployed. PAAMS provides an international forum to presents and discuss the latest scientific developments and their effective applications, to assess the impact of the approach, and to facilitate technology transfer. PAAMS started as a local initiative, but since grown to become the international yearly platform to present, to discuss, and to disseminate the latest developments and the most important outcomes related to real-world applications. It provides a unique opportunity to bring multi-disciplinary experts, academics and practitioners together to Exchange their experience in the development and deployment of Agents and Multiagents systems. PAAMS intends to bring together researchers and developers from industry and the academic world to report on the latest scientific and technical advances on the application of multi-agent systems, to discuss and debate the major issues, and to showcase the latest systems using agent based technology. It will promote a forum for discussion on how agent based techniques, methods and tools help system designers to accomplish the mapping between available agent technology and application needs. Other stakeholders should be rewarded with a better understanding of the potential and challenges of the agent-oriented approach. This edition of PAAMS special sessions is organized by the Bioinformatics, Intelligent System and Educational Technology Research Group (http://bisite.usal.es) of the University of Salamanca. The present edition was held in Salamanca, Spain, from 22nd to 24th May 2013
Reflective program generation with patterns
Runtime reflection facilities, as present in Java and.NET, are powerful mechanisms for inspecting existing code and metadata, as well as generating new code and metadata on the fly. Such power does come at a high price though. The runtime reflection support in Java and.NET imposes a cost on all programs, whether they use reflection or not, simply by the necessity of keeping all metadata around and the inability to optimize code because of future possible code changes. A secondâoften overlookedâcost is the difficulty of writing correct reflection code to inspect or emit new metadata and code and the risk that the emitted code is not well-formed. In this paper we examine a subclass of problems that can be addressed using a simpler mechanism than runtime reflection, which we call compile-time reflection. We argue for a high-level construct called a transform that allows programmers to write inspection and generation code in a pattern matching and template style, avoiding at the same time the complexities of reflection APIs and providing the benefits of staged compilation in that the generated code and metadata is known to be well-formed and type safe ahead of time
- âŚ